import sys

from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QGraphicsDropShadowEffect


class CardWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        # 设置卡片的阴影效果
        shadow_effect = QGraphicsDropShadowEffect(self)
        shadow_effect.setBlurRadius(10)
        shadow_effect.setColor(QColor(0, 0, 0, 60))
        shadow_effect.setOffset(5, 5)
        self.setGraphicsEffect(shadow_effect)

        # 设置卡片的尺寸和颜色
        self.setFixedSize(200, 100)
        self.setStyleSheet("background-color: white;")

        # 在卡片上绘制一些内容（例如文本）
        # ...

        # 布局设置
        layout = QVBoxLayout()
        layout.addWidget(self)

        # 创建窗口并设置布局
        main_window = QMainWindow()
        central_widget = QWidget()
        main_window.setCentralWidget(central_widget)
        central_widget.setLayout(layout)

        # 显示窗口
        main_window.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = CardWindow()
    sys.exit(app.exec_())
